--- install-sh	2006-03-25 20:04:46 +0000
+++ install-sh	2007-09-14 10:53:29 +0100
@@ -246,7 +246,10 @@
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
+    { $doit $mkdircmd "$dst" || lasterr=$?
+      # It's ok for mkdir to fail if the directory already exists.
+      test -d "$dst" || { (exit ${lasterr-1}); exit; }
+    } \
       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
